<?php


namespace app\api\controller\v1;


use app\BaseController;
use think\exception\HttpException;
use app\api\service\Token as TokenService;

class Token extends BaseController
{
    // 获取token
    public function getToken(){

    }

    // 验证token
    public function verifyToken(){
        if(request()->isPost()){
            $token = request()->header('Token');
            if(!$token){
                throw new HttpException(500,'非法参数,token不存在');
            }
            TokenService::verifyToken($token);

            return show(config('status.success'), "ok", [], 200);
        }
    }
}